<div id=main2>

<div id=main2>
		<div id="product">
			<div id="tproduct">
			<div class="tproduct"><p class="tp">Danh sách <?php echo $pageName;?>
</p></div>
			<div class="select">
			  </div></div>
			
			
<div id="listproduct">

<?php
		$id=(int)$_REQUEST["id"];
		$sql="SELECT * FROM product WHERE status=1 AND subcategory=$id ORDER By id DESC";
		$rs=mysql_query($sql);
		if(!$rs)
		{
			echo 'Danh mục này hiện không có sản phẩm nào!';
		}
		else
		{
			while($rw=mysql_fetch_array($rs))
			{
			
?>
			<div class="sanpham"><a href="product.php?id=<?php echo $rw['id'] ?>"><div id="anhsp"><img class="img" src="images/product/<?php echo $rw['image'];?>" border="0"/></a></div>
			<?php echo $rw['name']; ?><br />
			<p style="text-align:center">Mã SP: <?php echo $rw['code']; ?></p>
			<p class="gia"><?php echo number_format($rw['price'],0,',','.'); ?></p>
			<a href="product.php?cmd=add&id=<?php echo $rw["id"]?>"><img src="images/cho_vao_gio.png" border="0" /></a>
			<a href="buy.php?id=<?php echo $rw['id'] ?>"><img src="images/buy.png" boder="0"/></a>
			</div>
<?php

		}
	}
		
?>
			 </div>
		</div>
